import request from '@/utils/request'

/* 我的收藏 */
export const Favorites = () => request.get('user/favorites')

/* 我的出租 */
export const Userhouse = () => request.get('/user/houses')

/* 轮播图接口 */
export const Swiper = () => request.get('home/swiper')

/* 城市列表 */
export const City = () => request.get('area/city', { params: { level: 1 } })

/* 热门城市 */
export const HotCity = () => request.get('area/hot')

/* 搜索小区 */
export const community = (data) => request.get('area/community', {
  params: data
})

/* 获取房屋条件 */
export const getHome = () => request.get('houses/params')

/* 区域接口 */
export const getArea = (id) => request.get('houses/condition', { params: { id } })

/* 条件查询房屋接口 */
export const getHouse = (more) => request.get('houses', { params: { more } })

// 房屋图像上传
export const housesImg = data => request.post('/houses/image', data, {
  headers: { 'Content-Type': 'multipart/form-data' }
})
// 发布房源
export const housesParams = (body) => request.post('/user/houses', body)

// 地图数据

export const baiduMap = id => request.get('area/map', { params: { id } })
